package com.stellar.auth.basic.service.impl;

import com.stellar.auth.basic.dao.AuthRolePermissionDao;
import com.stellar.auth.basic.entity.AuthRolePermission;
import com.stellar.auth.basic.service.AuthRolePermissionService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;

/**
 * 角色权限关联表(AuthRolePermission)服务实现
 *
 * @author Jqchan
 * @since 2025-05-16 18:07:33
 */
@Service
public class AuthRolePermissionServiceImpl implements AuthRolePermissionService {
    
    @Resource
    private AuthRolePermissionDao authRolePermissionDao;

    @Override
    public AuthRolePermission queryById(Long id) {
        return authRolePermissionDao.queryById(id);
    }

    @Override
    public AuthRolePermission queryByCondition(AuthRolePermission condition) {
        return authRolePermissionDao.queryByCondition(condition);
    }

    @Override
    public List<AuthRolePermission> queryAllByCondition(AuthRolePermission condition) {
        return authRolePermissionDao.queryAllByCondition(condition);
    }

    @Override
    public List<AuthRolePermission> page(AuthRolePermission condition, int page, int pageSize) {
        return authRolePermissionDao.page(condition, page, pageSize);
    }

    @Override
    public int insert(AuthRolePermission entity) {
        return authRolePermissionDao.insert(entity);
    }

    @Override
    public int update(AuthRolePermission entity) {
        return authRolePermissionDao.update(entity);
    }

    @Override
    public int deleteById(Long id) {
        return authRolePermissionDao.deleteById(id);
    }

    @Override
    public Long count(AuthRolePermission condition) {
        return authRolePermissionDao.count(condition);
    }

    @Override
    public void insertBatch(List<AuthRolePermission> authRolePermissions) {
        authRolePermissionDao.insertBatch(authRolePermissions);
    }

    @Override
    public void deleteByRoleId(Long id) {
        authRolePermissionDao.deleteByRoleId(id);
    }

    @Override
    public List<AuthRolePermission> queryByRoleId(Long roleId) {
        return authRolePermissionDao.queryByRoleId(roleId);
    }

    @Override
    public List<AuthRolePermission> queryByRoleIds(List<Long> roleIds) {
        return authRolePermissionDao.queryByRoleIds(roleIds);
    }

    @Override
    public void deleteByPermissionId(Long permissionId) {
        authRolePermissionDao.deleteByPermissionId(permissionId);
    }

    @Override
    public void batchDeleteByPermissionIds(List<Long> permissionIds) {
        authRolePermissionDao.batchDeleteByPermissionIds(permissionIds);
    }

}
